<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        li{
            list-style:none;
        }
    </style>
</head>
<body>
    <div class="box">
        <p>
            <input type="text" v-model="val">
            <button v-on:click="click">提交</button>
        </p>
        <h1>待办事项</h1>
        <ul>
            <li v-for="(item , index) in arr" v-show="(!item.flag)">
                <input type="checkbox" v-model:checked="item.flag">
                {{item.val}}
                <button v-on:click="del(index)">删除</button>
            </li>
        </ul>
        <h1>完成事项</h1>
        <ul>
            <li v-for="(item , index) in arr" v-show="(item.flag)">
                <input type="checkbox" v-model:checked="item.flag" >
                {{item.val}}
            </li>
        </ul>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        new Vue({
            el:'.box',
            data:{
                val:'',
                arr:[],

            },
            methods:{
                click(value){
                    this.arr.push({
                        val:this.val,
                        flag:false,
                    });
                    console.log(this.arr)
                    this.val = ''
                },
                del(index){
                    this.arr.splice(index , 1);
                }
            }
        })
    </script>
</body>
</html>